package init

import (
	"go.uber.org/zap"
	"week2d/appconfig"
	"week2d/models/mysql"
	"week2d/models/redis"
)

func init() {
	//日志
	InitLogg()
	//动态配置文件
	appconfig.InitAppConfig()
	//数据库
	mysql.InitMysql()
	//缓存
	redis.InitRedis()
}

func InitLogg() {
	zapconfig := zap.NewDevelopmentConfig()

	zapconfig.OutputPaths = []string{
		"\\Users\\a\\Desktop\\week2d/week2d.log",
		"stdout",
	}
	logg, err := zapconfig.Build()
	if err != nil {
		zap.S().Info("日志编译失败", err)
		return
	}
	zap.ReplaceGlobals(logg)

}
